package cn.com.dcsgo.design.pattern.singleton;

import java.io.Serializable;

/**
 * 单例模式-懒加载-线程不安全
 *
 * @author Dcsgo
 * @since 2025/9/22 8:53
 */

public class LazySingleton2 implements Serializable {
    private static LazySingleton2 INSTANCE;

    /**
     * 私有化构造方法，不允许外部new实例化对象
     */
    private LazySingleton2() {

    }

    public static LazySingleton2 getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new LazySingleton2();
        }
        return INSTANCE;
    }
}
